class Workunit < ActiveRecord::Base
  belongs_to :user
  belongs_to :task
  belongs_to :activity
  # Amount cannot be greter than 24 hours.
  validates_numericality_of :amount, :less_than  => 24, :message => "cannot be greater than 24"

  # Amount cannot be less than 0 hour.
  validates_numericality_of :amount, :greater_than => 0, :message => "cannot be less than 0"

  # Amount (work hours) cannot be different from integer.
  validates_numericality_of :amount, :only_integer => true
end